package com.hengxinguotong.hxgtwygsp.ui.maintenance.budget;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.hengxinguotong.hxgtwygsp.R;
import com.hengxinguotong.hxgtwygsp.ui.base.BaseTabFragment;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.OnClick;

public class InAndOutFragment extends BaseTabFragment
{
    @BindView(R.id.budget_year_container)
    LinearLayout budgetYearContainer;
    @BindView(R.id.budget_year)
    TextView budgetYear;
    @BindView(R.id.budget_revenue_money)
    TextView budgetRevenueMoney;
    @BindView(R.id.budget_revenue_progress)
    ProgressBar budgetRevenueProgress;
    @BindView(R.id.budget_expense_money)
    TextView budgetExpenseMoney;
    @BindView(R.id.budget_expense_progress)
    ProgressBar budgetExpenseProgress;
    @BindView(R.id.budget_balance_money)
    TextView budgetBalanceMoney;
    @BindView(R.id.budget_balance_progress)
    ProgressBar budgetBalanceProgress;

    private boolean dismissYear = false;

    @Inject
    public InAndOutFragment()
    {
    }


    @Override
    public int getLayoutResId()
    {
        return R.layout.fragment_budget;
    }

    @Override
    public void init()
    {
        mockView();
        if (dismissYear)
        {
            budgetYearContainer.setVisibility(View.INVISIBLE);
        }
    }

    private void mockView() {
        budgetRevenueMoney.setText(String.format(getString(R.string.budget_money),81520.00f));
        budgetExpenseMoney.setText(String.format(getString(R.string.budget_money),0.00f));
        budgetBalanceMoney.setText(String.format(getString(R.string.budget_money),44032.00f));
        budgetRevenueProgress.setProgress(2000000);
        budgetExpenseProgress.setProgress(2500000);
        budgetBalanceProgress.setProgress(0);
    }

    @OnClick({R.id.budget_left, R.id.revenue_right})
    public void onViewClicked(View view)
    {
        switch (view.getId())
        {
            case R.id.budget_left:
                break;
            case R.id.revenue_right:
                break;
        }
    }

    public void setDismissYear(boolean dismissYear)
    {
        this.dismissYear = dismissYear;
    }
}
